package com.example.wsocket.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author renyitong
 * @description: TODO
 * @date 2023年07月12日
 */
@RestController
public class TestController {

    @Autowired
    private StringRedisTemplate redisTemplate;

    @GetMapping("/send/maeeage")
    public String sendMessage(String message){
        redisTemplate.convertAndSend("socket-1",message);
        return "success";
    }

}
